package com.oktest.measure.db.room

import androidx.room.*
import com.oktest.measure.entity.HomeTask

/**
 * @Author hhh
 * @Date 2020/10/24
 */
@Dao
interface HomeTaskDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(list:List<HomeTask>)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(homeTask: HomeTask)

    @Query("select * from HomeTask where id=:id")
    fun query(id: String): HomeTask?

    @Query("select * from HomeTask order by startupTime")
    fun loadAll(): List<HomeTask>

    @Delete()
    fun delete(homeTask: HomeTask?)

    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun update(homeTask: HomeTask)
}